<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;


    /**
     * @param int $code 错误码
     * @param string $msg 返回信息
     * @param array $data 返回数据
     *
     */
    public function returnJson($code = 200, $msg = 'success', $data = [])
    {
        return json_encode(['code' => $code, 'msg' => $msg, 'data' => $data]);
    }
}
